﻿@using GoodMan.Infrastructure.Entities.Entity;
@{
    ViewBag.Title = "修改公告";
    Layout = "~/Areas/WorkSpace/Views/Shared/_CollegeAdminTemplete.cshtml";
    Notice noticeModel = ViewBag.NoticeModel;
}

@section head{
    <style type="text/css">
        .nav .active
        {
            /*background: url(<?php echo $this->img('manage_r2_c13.jpg');?>) no-repeat;*/
            background-color: #F5F5F5;
        }
        .nav .other
        {
            /* background: url(<?php echo $this->img('manage_r2_c14.jpg');?>) no-repeat;*/
            background-color: #E9E9E9;
        }
        h2.nav
        {
            border-bottom: 1px solid #B4C9C6;
            font-size: 13px;
            height: 25px;
            line-height: 25px;
            margin-top: 0px;
            margin-bottom: 0px;
        }
        h2.nav a
        {
            color: #999999;
            display: block;
            float: left;
            height: 24px;
            width: 113px;
            text-align: center;
            margin-right: 1px;
            margin-left: 1px;
            cursor: pointer;
        }
    </style>
}
<div id="content-header">
    <h1>
        发布公告</h1>
</div>
<div id="breadcrumb">
    <a href="/workspace/collegeadmin/index" title="Go to Home" class="tip-bottom"><i class="icon-home"></i>首页</a>
    <a href="/workspace/collegeadmin/NoticeList?page=@ViewBag.page" class="tip-bottom">公告管理</a> <a href="/workspace/collegeadmin/NoticeList?page=@ViewBag.page"
        class="current">公告列表</a> <a href="#" class="current">修改</a>
</div>
<div class="container-fluid">
    <div class="row-fluid">
        <div class="span12">
            <div class="widget-box">
                <div class="widget-title">
                    <span class="icon"><i class="icon-align-justify"></i></span>
                    <h5>
                        发布公告</h5>
                </div>
                <div class="widget-content nopadding">
                    <form id="regform" action="/workspace/collegeadmin/NoticeModify" method="post" name="regform"
                    class="form-horizontal">
                     <input type="hidden" name="page" value="@ViewBag.page" />
                    <input type="hidden" name="Id" value="@noticeModel.Id" />
                    <div id="tab1">
                        <div class="control-group">
                            <label class="control-label">
                                标题</label>
                            <div class="controls">
                                <input type="text" placeholder="请输入标题" name="Title" value="@noticeModel.Title" readonly="readonly" style="width: 200px" class="span4" />
                                <span style="color: Red; font-size: 20px">&nbsp;&nbsp;*</span>
                            </div>
                        </div>
                        <div class="control-group">
                            <label class="control-label">
                                子标题</label>
                            <div class="controls">
                                <input type="text" placeholder="请输入子标题" name="SubTitle" value="@noticeModel.SubTitle" class="span4 {required:true} "
                                    style="width: 200px" />
                            </div>
                        </div>
                        <div class="control-group">
                            <label class="control-label">
                                内容(<span style="color: Red; font-size: 20px">*</span>)</label>
                            <div class="controls">
                                <script id="editor" name="Content" class="required" type="text/plain">@Html.Raw(noticeModel.Content)</script>
                                <script type="text/javascript" charset="utf-8" src="/Scripts/UEditor/editor_config.js"></script>
                                <script type="text/javascript" charset="utf-8" src="/Scripts/UEditor/editor_all_min.js"></script>
                                <script type="text/javascript">
                                    UE.getEditor('editor');
                                </script>
                            </div>
                        </div>
                        @{
                            if (ViewBag.Error != null)
                            {
                                if (ViewBag.Error == "")
                                { 
                            <div class="alert alert-success">
                                <strong style="width: 50%; margin: 0px auto">操作成功！</strong></div>
                                }
                                else
                                {
                            <div class="alert alert-error">
                                <strong style="width: 50%; margin: 0px auto">@ViewBag.Error</strong></div>
                                }
                            }
                        }
                        <div class="form-actions">
                            <button type="submit" class="btn btn-primary">
                                保存</button>
                        </div>
                    </div>
                    </form>
                </div>
            </div>
        </div>
    </div>
</div>


@section tail{
<script type="text/javascript" src="/scripts/jquery.js"></script>

    <script type="text/javascript" src="/Scripts/jquery.validate.js"></script>
    <script type="text/javascript" src="/Scripts/jquery.metadata.js"></script>
<script type="text/javascript">
    var validation = new plug.BindValidCode();
    $(function () {

        validation.BindValidator();
        $('#regform').validate({
            errorClass: "help-inline",
            errorElement: "span",
            highlight: function (element, errorClass, validClass) {
                $(element).parents('.control-group').addClass('error');
            },
            unhighlight: function (element, errorClass, validClass) {
                $(element).parents('.control-group').removeClass('error');
            }
        });

        $('#likNotice').addClass('open');
        $('#likNotice').addClass('active');
    });
    </script>
}